查询用户授权的实名信息
商户可以根据face_sid查询用户UnionId,调用该接口获取授权的实名信息商户需要先申请权限。
请求参数 | 类型 | 描述 |
---|---|---|
face_sid | string | 终端设备识别用户成功后返回的凭证 |
query | object | 声明请求的查询参数 |
info_type | string | 标识本次请求获取的信息类型ASK_UNIONID | ASK_REAL_NAME 枚举值之一 |
appid | string | 微信分配的公众账号ID |
sub_mchid | string | 微信支付分配的子商户号,服务商模式下必填 |
sub_appid | string | 微信分配的子商户公众账号ID |
sub_serial_no | string | ⼦商户证书序列号,服务商模式下请求实名信息必传 |
php
$instance->v3->facemch->users->_face_sid_->getAsync([
'face_sid' => 'aabbccdd12345',
'query' => [
'info_type' => 'ASK_UNIONID',
'appid' => 'wx2b029c08a6233333',
'sub_mchid' => '123456789',
'sub_appid' => 'wx2b029c08a6255555',
'sub_serial_no' => 'wx2b029c08a6255555',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/facemch/users/{face_sid}')->getAsync([
'face_sid' => 'aabbccdd12345',
'query' => [
'info_type' => 'ASK_UNIONID',
'appid' => 'wx2b029c08a6233333',
'sub_mchid' => '123456789',
'sub_appid' => 'wx2b029c08a6255555',
'sub_serial_no' => 'wx2b029c08a6255555',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/facemch/users/{face_sid}']->getAsync([
'face_sid' => 'aabbccdd12345',
'query' => [
'info_type' => 'ASK_UNIONID',
'appid' => 'wx2b029c08a6233333',
'sub_mchid' => '123456789',
'sub_appid' => 'wx2b029c08a6255555',
'sub_serial_no' => 'wx2b029c08a6255555',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->facemch->users->_face_sid_->get([
'face_sid' => 'aabbccdd12345',
'query' => [
'info_type' => 'ASK_UNIONID',
'appid' => 'wx2b029c08a6233333',
'sub_mchid' => '123456789',
'sub_appid' => 'wx2b029c08a6255555',
'sub_serial_no' => 'wx2b029c08a6255555',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/facemch/users/{face_sid}')->get([
'face_sid' => 'aabbccdd12345',
'query' => [
'info_type' => 'ASK_UNIONID',
'appid' => 'wx2b029c08a6233333',
'sub_mchid' => '123456789',
'sub_appid' => 'wx2b029c08a6255555',
'sub_serial_no' => 'wx2b029c08a6255555',
],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/facemch/users/{face_sid}']->get([
'face_sid' => 'aabbccdd12345',
'query' => [
'info_type' => 'ASK_UNIONID',
'appid' => 'wx2b029c08a6233333',
'sub_mchid' => '123456789',
'sub_appid' => 'wx2b029c08a6255555',
'sub_serial_no' => 'wx2b029c08a6255555',
],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典 | 类型 | 描述 |
---|---|---|
union_id | string | UnionID |
openid | string | 用户在商户appid下的唯⼀标识 |
sub_openid | string | 用户在⼦商户appid下的唯⼀标识 |
real_name_info | object | 姓名信息 |
encrypted_real_name | string | 加密后的姓名信息,商户用API证书私钥解密 |
credential_type | integer | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 枚举值之一 |
encrypted_credential_id | string | 加密后的身份证号,商户用API证书私钥解密 |
参阅 官方文档